package paperless.main;

import java.util.ArrayList;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class MyAdapter extends BaseAdapter {

	private ArrayList<Integer> listCoupon = new ArrayList<Integer>();
	Context mContext;

	public MyAdapter(Context context, ArrayList<Integer> listCoupon) {
		mContext = context;
		this.listCoupon = listCoupon;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return listCoupon.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return listCoupon.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		NoCouponView v;
		if (convertView == null) {
			v = new NoCouponView(mContext);
		} else {
			v = (NoCouponView)convertView;
		}
		return v;
	}
}
